<?php
/**
 *
 * @author 李大牛家的牛 (scafel@163.com)
 * @className layout-sider.blade.php
 * @createDate 2025/7/28 - 21:49
 * @description
 **/
?>

<div class="layui-side layui-bg-black" id="LDN_APP_SIDE">
    <div class="layui-side-scroll">
        <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
        <ul class="layui-nav layui-nav-tree" lay-filter="test" lay-accordion>
            @foreach($rules as $rule)
                <li class="layui-nav-item">
                    @if(isset($rule["children"]) && count($rule["children"]) > 0)
                        <a class="" href="javascript:void(0);">
                            <i class="layui-icon layui-icon-{{ $rule["ltar003"] }}"> </i>
                            {{ $rule["ltar001"] }}
                        </a>
                        <dl class="layui-nav-child">
                            @foreach($rule["children"] as $child)
                                <dd>
                                    @if(isset($child["children"]) && count($child["children"]) > 0)
                                        <a class="" href="javascript:void(0);">
                                            <i style="display:inline-block;width: 10px;"> </i>
                                            <i class="layui-icon layui-icon-{{ $child["ltar003"] }}"> </i>
                                            {{ $child["ltar001"] }}
                                        </a>
                                        <dl class="layui-nav-child">
                                            @foreach($child["children"] as $son)
                                                <dd>
                                                    <a href="{{ $rule["ltar002"].$child["ltar002"].$son["ltar002"] }}" target="main">
                                                        <i style="display:inline-block;width: 20px;"> </i>
                                                        <i class="layui-icon layui-icon-{{ $son["ltar003"] }}"> </i>
                                                        {{ $son["ltar001"] }}
                                                    </a>
                                                </dd>
                                            @endforeach
                                        </dl>
                                    @else
                                        <a href="{{ $rule["ltar002"].$child["ltar002"] }}" target="main">
                                            <i style="display:inline-block;width: 10px;"> </i>
                                            <i class="layui-icon layui-icon-{{ $child["ltar003"] }}"> </i>
                                            {{ $child["ltar001"] }}
                                        </a>
                                    @endif
                                </dd>
                            @endforeach
                        </dl>
                    @else
                        <a class="" href="{{ $rule["ltar002"] }}" target="main">
                            <i class="layui-icon layui-icon-{{ $rule["ltar003"] }}"> </i>
                            {{ $rule["ltar001"] }}
                        </a>
                    @endif
                </li>
            @endforeach
        </ul>
    </div>
</div>
